package controller;

import core.BaseServlet;
import service.SelfInfoService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "SelfInfoServlet", urlPatterns = "/selfInfo")
public class SelfInfoServlet extends BaseServlet {

    private SelfInfoService selfInfoService = new SelfInfoService();
    /**
     * 个人信息管理页面
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public void selfInfoManagePage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getRequestDispatcher("/WEB-INF/pages/selfInfoManage/selfInfoManage.jsp").forward(request, response);
    }

    /**
     * 编辑个人信息
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public void editSelfInfo(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        selfInfoService.editSelfInfo(request, response);
    }
}
